//
//  Int+Extensions.swift
//  Easepods
//
//  Created by 李然 on 2024/6/17.
//

import Foundation


extension Int? {
    var hourAndMinTimeFormat: String {
        guard let minete = self else {
            return "--" + R.string.localizable.common_unit_hour() + "--" + R.string.localizable.common_unit_minute()
        }
        guard minete >= 0 else { return "" }
        if minete < 60 {
            return "\(minete)" + R.string.localizable.common_unit_minute()
        }
        let hours = minete / 60
        let remainingMinutes = minete % 60
        return "\(hours)" + R.string.localizable.common_unit_hour() + "\(remainingMinutes)" + R.string.localizable.common_unit_minute()
    }
}
